//
//  XMGLoginRegisterView.m
//  BuDeJie19
//
//  Created by hjj on 2016/12/3.
//  Copyright © 2016年 hjjuny. All rights reserved.
//
#import "XMGLoginRegisterView.h"

@interface XMGLoginRegisterView ()
@property (weak, nonatomic) IBOutlet UIButton *loginButton;
@end

@implementation XMGLoginRegisterView

+ (instancetype)loginView
{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] firstObject];
}

+ (instancetype)registerView
{
     return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
}

// 只要从文件加载就会调用
// xib中很多属性还没有设置
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super initWithCoder:aDecoder]) {
       
    }
    return self;
}

// 加载xib完成的时候调用，把xib里面的所有的属性赋值
- (void)awakeFromNib
{
    
    [super awakeFromNib];
    
    UIImage *image = self.loginButton.currentBackgroundImage;
    image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
    [self.loginButton setBackgroundImage:image forState:UIControlStateNormal];
    
//     NSLog(@"%@",self.loginButton);
}


@end
